package org.pr.ddddesigner.infrastructure.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.web.util.UriComponentsBuilder;

import java.net.URI;
import java.util.Collections;

/**
 * @author chenbin
 */
@Component
@ConfigurationProperties(prefix = "xw.api.soon-manager")
@Setter
public class XwSceneManagerApiProperties {
    @Getter
    private String url;
    private String apiPrefix;
    private String buildScene;

    public URI buildScene() {
        return UriComponentsBuilder.fromHttpUrl(url).path(apiPrefix).path(buildScene).build(Collections.emptyMap());
    }
}
